package com.lzb.play.adapter;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.lzb.play.R;
import com.lzb.play.basic.ProviderMultiAdapter;
import com.lzb.play.bean.HomeBirdBean;

public class HomeBirdAdapter extends ProviderMultiAdapter<HomeBirdBean> {

    public HomeBirdAdapter() {
        addItemProvider(new HomeBirdProvider());
    }

    private class HomeBirdProvider extends BaseItemProvider<HomeBirdBean> {
        @Override
        public int getItemViewType() {
            return ProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_home_bird;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, HomeBirdBean bean) {
            baseViewHolder.setImageResource(R.id.ivHomeBirdItemImg, bean.getImg());
            baseViewHolder.setText(R.id.tvHomeBirdItemName, bean.getBirdBean().getName());
            baseViewHolder.setText(R.id.tvHomeBirdItemAlias, bean.getBirdBean().getAlias());
        }
    }

}
